import requests from '@/api/request'
const SERVER_URL = ''
export default {
  // 查询职务
  postQueryRoleData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/queryByCondition`,
      method: 'post',
      data
    })
  },
  // 新增职务
  postAddRoleData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/add`,
      method: 'post',
      data
    })
  },
  // 编辑
  putEditRoleData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/edit`,
      method: 'put',
      data
    })
  },
  // 查询单条详情
  getRoleDetailData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/queryById/${data}`,
      method: 'get'
    })
  },
  // 职务关联用户
  postRoleRelateUserData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/relate/user`,
      method: 'post',
      data
    })
  },
  // 查询角色系统权限
  getRolePermission (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/queryRolePermissionById/${data}`,
      method: 'get'
    })
  },
  // 查询全部系统权限
  getAllRolePermission (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/permission/query/tree/${data}`,
      method: 'get'
    })
  },
  // 修改角色操作权限
  postChangeSystemPermissionsData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/change/systemPermission`,
      method: 'post',
      data
    })
  },
  // 修改角色数据权限
  postChangeDataPermissionsData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/change/dataPermissions`,
      method: 'post',
      data
    })
  },
  // 停用角色
  postCloseRoleData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/close`,
      method: 'post',
      data
    })
  },
  // 启用角色
  postOpenRoleData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/open`,
      method: 'post',
      data
    })
  },
  // 删除角色
  deleteRoleData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/delete/${data}`,
      method: 'delete',
      data
    })
  },
  // 复制权限
  copyUserRules (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/copy`,
      method: 'post',
      data
    })
  }
}
